import baseController from './baseController';

import {Router, Get} from '../decorators/router';
import MongoClient from "../config/mongo";
// @ts-ignore
@Router("/field")
export default class extends baseController {

    @Get("/add")
    async add() {
        const user = MongoClient.collection('user');
        var result = await user.insertMany([{username: 1111}]);
        return this.success(result);
    }

    @Get("/list")
    list() {
        return this.success({list_field: "im list func"});
    }

    edit(): object {
        return {ok: "a"};
    }
}